//
//  BpModel.h
//  project
//
//  Created by 黄建华 on 2018/2/6.
//  Copyright © 2018年 黄建华. All rights reserved.
//

#import <Foundation/Foundation.h>
// 每次血压模型
@interface bpSubModel : NSObject
@property (nonatomic, assign) NSInteger count;                 // 用分钟表示
@property (nonatomic, assign) NSInteger countMins;             // 分钟
@property (nonatomic, strong) NSString  *updateTime;           // 按count计算15分钟的间隔对应时间
@property (nonatomic, assign) NSInteger SBPValue;              // 舒张压
@property (nonatomic, assign) NSInteger DBPValue;              // 收缩压
@end

@interface BpModel : NSObject
@property (nonatomic, strong) NSString *user_id;
@property (nonatomic, strong) NSString *mac;
@property (nonatomic, strong) NSString *dateString;
@property (nonatomic, assign) BOOL     isSaveAllDay;   // 是否保存了全天

@property (nonatomic, assign) NSInteger dayOfWeek;
@property (nonatomic, assign) NSInteger dayOfMonth;
@property (nonatomic, assign) NSInteger weekCount;     // 当前星期
@property (nonatomic, assign) NSInteger monthCount;    // 当前月份
@property (nonatomic, assign) NSInteger yearCount;     // 当前年份
// 血压
@property (nonatomic, assign) NSInteger      SBPAve;           // 平均舒张压
@property (nonatomic, assign) NSInteger      DBPAve;           // 平均收缩压
@property (nonatomic, strong) NSMutableArray *bpSuArray;       // 每天血压数组

@property (nonatomic, strong) NSString *detailData;    // 详细数据

+ (BpModel *)initWithDate:(NSDate *)date;
+ (BpModel *)getBpModelFromDB;
+ (BpModel *)getBpModelFromDBWith:(NSDate *)date;
+ (BpModel *)getBpModelFromDBWithDayString:(NSString *)string;
- (void)     updateToDBSafely;

// 手动同步完之后 血压
+ (void)updateCheckBP;
- (void)updateRealBPData:(NSInteger)Sbp withBp:(NSInteger)Dbp;
- (void)updateRealBPDataEnd:(NSArray *)bpArray;
//同步下载数据需要的
- (void)saveToDBByDownload;

@end

